package com.example.rbacmanage.controller.system;

import com.example.rbacmanage.common.Result;
import com.example.rbacmanage.common.enums.UploadTypeEnum;
import com.example.rbacmanage.service.system.UploadFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/system/common")
public class CommonController {
    @Autowired
    private UploadFileService uploadFileService;
    @PostMapping(value = "/upload")
    public Result updateFile(@RequestParam("file") MultipartFile file){
        return Result.success(uploadFileService.uploadFile(UploadTypeEnum.LOCALUPLOAD.getType(),file));
    }
}
